This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 24, 2011, 9:24 PM
11 Posts

Help Please

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: function,problem
  • Replies: 1
Hi everybody,
 
I've a problem, spend several hours with this: 
 
I have updated my domino server, from version 8.5.1 FP5 to 8.5.2 FP2. 
 
When called a server side function in a library and passing a document by argument, my xpage application fail, this is the error message:
 
 "Error while executing JavaScript computed expression
Script interpreter error, line=4, col=1: [TypeError] Error calling method 'esAutorFoco(lotus.domino.local.Document)' on an object of type 'object [JavaScript Object]'

JavaScript code

   1: var oDoc:NotesDocument = planNuevo.getDocument();
   2: esAutorFoco(oDoc);"
 
PlanNuevo is a datasource 
 
This is the function: 
 
"

function esAutorFoco(odoc:NotesDocument){

if ( odoc == null ) return false;

var valor:java.util.Vector = odoc.getItemValue("AsignadoCTO");

if ( valor.size() == 0 ) return false;

for ( var i = 0 ; i < valor.size() ; i++ ){

if ( valor.indexOf(@Name("[CN]",@UserName())) != -1) return true;

}

return false;

}

 
This isn't the only function when this happens.
 
What am I doing wrong? 
 
thanks in advance  
 
best regards 
 
Manuel. 
May 27, 2011, 1:48 AM
2 Posts
Re: Help Please
[TypeError] Error calling method 'esAutorFoco(lotus.domino.local.Document)' on an object of type 'object [JavaScript Object]'

JavaScript code

   1: var oDoc:NotesDocument = planNuevo.getDocument();
 
Looks like oDoc is not getting set to anything at this point, so the code is treating it as an unknown JavaScript object.   
 
Where is planNuevo coming from / getting assigned?  I would guess it's from the "var" variable of a view or repeat.    
 
You could test it by trying to use it to compute a value in a ComputedText field   (ex.  planNuevo.getDocument().getNoteID() )   That is a simple test to make sure it really is getting a handle on a Notes document.
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal